package com.hyt.it.ogt.kq.service.gov.feign.ks;


import com.hyt.common.apiInfor.ApiResponse;
import com.hyt.core.exception.RemoteRequestException;
import com.hyt.it.ogt.kq.service.gov.feign.ks.model.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;

/**
 * 考试客户端熔断器
 * 
 * @author chengxh
 * @since 2021-11-23
 */
@Component
@Slf4j
public class KsClientHystrix implements KsClient {

    @Override
    public ApiResponse<Object> pushTime(PushTimeTaskParam pushTimeParam) {
        log.error("推送批次数据失败，进入熔断");
        return null;
    }

    @Override
    public ApiResponse<Object> pushCandidateNotice(PushCandidateNoticeParam pushCandidateNoticeParam) {
        log.error("推送考生须知数据失败，进入熔断");
        return null;
    }

    @Override
    public ApiResponse<Object> pushHello(PushHelloParam pushHelloParam) {
        log.error("推送欢迎语数据失败，进入熔断");
        return null;
    }

    @Override
    public ApiResponse<Object> pushExamConfig(PushExamConfigVO pushExamConfigVO) {
        log.error("推送考试配置数据失败，进入熔断");
        return null;
    }

/*    @Override
    public ApiResponse<Object> pushTimeRoomCandidate(PushTimeRoomCandidateParam pushTimeRoomCandidateParam) {
        log.error("推送编排数据失败，接口进入熔断");
        return null;
    }*/

    @Override
    public ApiResponse<Object> pushCandidate(PushTimeRoomCandidateParam param) {
        log.error("推送单个考生编排数据失败，接口进入熔断");
        return null;
    }

    @Override
    public ApiResponse<?> getExamUrl(String examId) {
        log.error("通过考试id获取考试地址失败，进入熔断");
        return null;
    }

    @Override
    public ApiResponse<Boolean> deleteTask(String taskId) {
        log.error("删除考试任务失败，进入熔断");
        throw new RemoteRequestException(43010704, "考试任务删除失败", taskId);
    }


    @Override
    public ApiResponse<?> updateCandidate(PushTimeRoomCandidateVO param) {
        log.error("更新考生信息至考试端失败，接口进入熔断");
        return null;
    }

    /**
     * 推送批次数据
     *
     * @param pushTimeParam
     * @return 返回推送结果
     */
    @Override
    public ApiResponse<Object> pushTimeSubject(PushTimeSubjectParam pushTimeParam){
        log.error("推送批次科目数据至考试端失败，接口进入熔断");
        return null;
    }
}
